using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

public class UICountdown : MonoBehaviour
{
	public GameObject content;

	public Text countdownText;

	private void Awake()
	{
		content.SetActive(value: false);
		countdownText.text = string.Empty;
	}

	public void Show()
	{
		content.SetActive(value: true);
		content.transform.localScale = Vector3.zero;
		content.transform.DOScale(1f, 0.2f).SetEase(Ease.OutBack);
	}

	public void Hide()
	{
		content.transform.DOScale(0f, 0.2f).OnComplete(delegate
		{
			content.SetActive(value: false);
		});
	}

	public void SetCountdown(int countdown)
	{
		countdownText.transform.localScale = Vector3.zero;
		countdownText.transform.DOScale(1f, 0.2f);
		if (countdown > 0)
		{
			countdownText.text = countdown.ToString();
		}
		else
		{
			countdownText.text = LocalizationManager.GetTranslation("TXT_GAME_GO");
		}
	}
}
